# Maintainer: Filipe Laíns (FFY00) <lains@archlinux.org>
# Maintainer: Caleb Maclennana <caleb@alerque.com>

_pkgname=MyST-Parser
pkgname=python-myst-parser
pkgver=2.0.0
pkgrel=1
pkgdesc='An extended commonmark compliant parser, with bridges to docutils/sphinx'
arch=('any')
url='https://github.com/executablebooks/MyST-Parser'
license=('MIT')
depends=('python' 'python-docutils' 'python-jinja' 'python-markdown-it-py' 'python-mdit_py_plugins' 'python-pygments' 'python-sphinx' 'python-yaml')
optdepends=('python-linkify-it-py: linkify support')
makedepends=('python-build' 'python-installer' 'python-flit-core' 'python-wheel')
checkdepends=('python-beautifulsoup4' 'python-linkify-it-py' 'python-pytest' 'python-pytest-param-files' 'python-pytest-regressions' 'python-sphinx-pytest')
source=("$url/archive/v$pkgver/$pkgname-$pkgver.tar.gz")
sha512sums=('c47bdd773565e93c4714d318a70f9a8adab1be6e2a63c23175667fc4afb5da4d66b84e11176782c8202e9fd68883e74d444911ddfb0b91356c2ba07fa65f7ea4')

build() {
  cd $_pkgname-$pkgver

  python -m build -wn
}

check() {
  cd $_pkgname-$pkgver

  python -m pytest \
    -k 'not test_sphinx_builds and not fixtures and not test_myst_config and not test_myst_refs' \
    --disable-warnings
}

package() {
  cd $_pkgname-$pkgver

  python -m installer -d "$pkgdir" dist/*.whl

  install -Dm 644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}

# vim:set ts=2 sw=2 et:
